package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.myapplication.mienum.MiObjectType;
import com.hxc.basemodule.BaseActivity;

public class AddProjectActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setImmersiveWindows();
        setTitle("添加设备");
        showBackButton();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_add_project;
    }
    public void onButtonClick(View view){
        if (view.getId()==R.id.btAddDoorSensor){
            Intent intent=new Intent();
            intent.putExtra("device_type", MiObjectType.DOOR_SENSOR);
            intent.putExtra("device_name","我的门栏");
            intent.putExtra("device_tip","框住你的心");
            setResult(RESULT_OK,intent);
        }else if (view.getId()==R.id.btAddAirCondition){
            Intent intent=new Intent();
            intent.putExtra("device_type", MiObjectType.AIR_CONDITION);
            intent.putExtra("device_name","我的空调");
            intent.putExtra("device_tip","凉凉爽爽");
            setResult(RESULT_OK,intent);
        }else if (view.getId()==R.id.btAddFun){
            Intent intent=new Intent();
            intent.putExtra("device_type", MiObjectType.FAN);
            intent.putExtra("device_name","我的风扇");
            intent.putExtra("device_tip","如果春风有意");
            setResult(RESULT_OK,intent);
        }else if (view.getId()==R.id.btAddLight){
            Intent intent=new Intent();
            intent.putExtra("device_type", MiObjectType.LIGHT);
            intent.putExtra("device_name","我的电灯");
            intent.putExtra("device_tip","灯泡爱发光");
            setResult(RESULT_OK,intent);
        }
        finish();
    }
}